require.config({
  baseUrl: '../',
  paths: {
    'jquery': 'public/js/lib/jquery-1.9.1.min.js',
    'NProgress': 'public/js/lib/nprogress/nprogress.min.js',
    'layer': 'public/js/lib/layer/layer.js',
    'service': 'config/service.js'
  },
  shim: {
    'layer': {
      deps: ['jquery']
    }
  }
});
define(['jquery', 'NProgress', 'layer', 'service'], function ($, NProgress) {
  $(document).ajaxStart(function () {
    NProgress.start();
  });
  $(document).ajaxComplete(function () {
    NProgress.done(true);
  });
});